import Vue from 'vue'
import VueRouter from 'vue-router'
// 一级路由
import Layout from '@/views/layout.vue'
import City from '@/views/city.vue'
import Map from '@/views/map.vue'

// 二级路由
import Article from '@/views/article.vue'
import Findroom from '@/views/findroom.vue'
import Info from '@/views/info.vue'
import User from '@/views/user.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/article',
    children: [
      {
        path: '/article',
        component: Article
      },
      { path: 'findroom', component: Findroom },
      { path: 'info', component: Info },
      { path: 'user', component: User }
    ]
  },
  { path: '/city', component: City },
  { path: '/map', component: Map }
]

const router = new VueRouter({
  routes
})

export default router
